package com.stx.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.stx.mapper.PlayerMapper;
import com.stx.pojo.Player;
import com.stx.service.IPlayerService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PlayServiceImpl extends ServiceImpl<PlayerMapper, Player> implements IPlayerService {
    @Override
    public List<Player> findByName(Player player) {
        LambdaQueryWrapper<Player> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(Player::getPlaName, player.getPlaName()).
                eq(Player::getPlaGender, player.getPlaGender()).
                eq(Player::getPlaDepartment, player.getPlaDepartment());
        List<Player> players = baseMapper.selectList(wrapper);
        return players;
    }
}
